<template>
	<view class="page-container">
		<view class="user-profile">
			<image class="avatar" :src="Lists.avatar" mode=""></image>
			<text class="username">{{ Lists.name }}</text>
			<text class="no">司机编号：{{ Lists.number }}</text>
			<text class="mobile">手机号码：{{ Lists.phone }}</text>
		</view>
		<view class="month-overview">
			<view class="title">我的任务</view>
			<view class="content">
				<view class="item">
					<text class="volumn">{{ data.completedAmounts }}</text>
					<text class="label">任务总量</text>
				</view>
				<view class="item">
					<text class="volumn">{{ data.taskAmounts }}</text>
					<text class="label">完成任务量</text>
				</view>
				<view class="item">
					<text class="volumn">{{ data.transportMileage }}</text>
					<text class="label">运输里程(km)</text>
				</view>
			</view>
		</view>
		<view class="entry-list">
			<uni-list :border="false">
				<uni-list-item to="/subpkg_user/truck/index" showArrow title="车辆信息" />
				<uni-list-item to="/subpkg_user/task/index" showArrow title="任务数据" />
				<uni-list-item to="/subpkg_user/settings/index" showArrow title="系统设置" />
			</uni-list>
		</view>
	</view>
</template>

<script setup>
import { ref, onMounted } from 'vue';
import { myList, taskList } from '@/apis/my.js';
const Lists = ref({});
const data = ref({});
const month = ref('07');
const year = ref('2002');
onMounted(async () => {
	const List = await myList();
	Lists.value = List.data;
	console.log('我的信息', Lists.value);
	const res = await taskList({ month: month.value, year: year.value });
	data.value = res.data;
	console.log('任务数据', res);
});
</script>

<style lang="scss" scoped>
@import './index.scss';
</style>
